<template>
	<view class="comAll" v-if="info.create_time">
		<view class="title">
			<text class="subTitle">{{info.title}}</text>
			<text v-if="fileType === 1" class="subText" @click="showFile">查看源文件</text>
		</view>
		<view class="content">
			<view class="contentLeft">
				<image mode="aspectFill" class="leftIcon" :src="IconPath"></image>
				<text>{{info.views}}</text>
			</view>
			<view class="contentRight">
				<text>{{formatTime(info.create_time, 'Y-M-D h:m')}}</text>
			</view>
			<view class="clear"></view>
		</view>
	</view>
</template>

<script>
	import {
		formatTime
	} from '@/utils/tools.js'
	export default {
		props: {
			info: Object,
			fileType: Number,
		},
		methods: {
			formatTime,
			showFile() {
				this.$emit('showFile', this.info.id)
			}
		},
		data() {
			return {
				IconPath: require('../../static/index/eye.png'),
			}
		},
	}
</script>

<style scoped>
	.comAll {
		background-color: #FFF;
		height: 100%;
		padding: 12upx 17upx;
		border-radius: 15upx;
		box-sizing: border-box;
	}

	.title {
		font-size: 36upx;
		color: #333333;
		font-weight: 300;
	}

	.subTitle {}

	.subText {
		color: #e67b7b;
		font-size: 24upx;
		right: 35rpx;
		position: absolute;
		font-weight: 600;
	}
	.subText:active{
		text-underline: inherit;
	}
	.content {
		padding-top: 17upx;
	}

	.contentLeft {
		float: left;
		font-size: 20upx;
		color: #6d6d6d;
	}

	.contentRight {
		float: right;
		font-size: 20upx;
		color: #6d6d6d;
	}

	.leftIcon {
		width: 28upx;
		margin-top: 7upx;
		margin-right: 7upx;
		height: 20upx;
	}
</style>
